<?
require_once ('config.php');
require_once ('functions.php');

$mysqli_link = ff_mysql_init (DB_HOST, DB_USER, DB_PASS, DB_NAME);
if ($mysqli_link !== FALSE) {
	$mysqli_link->query("SET NAMES 'latin1'");
	$sql_query = 'TRUNCATE TABLE `' . DB_TABLE_CATALOG_BASE . '`';
	$mysqli_link->query($sql_query);
	
	$sql_query = "SELECT privateid FROM `" . DB_TABLE_CATALOG . "` group by privateid";
	$result = $mysqli_link->query($sql_query);
	if (($result->num_rows) >0) {
		while ($sql_row = $result->fetch_assoc()) {
			$sql_query = "INSERT INTO `" . DB_TABLE_CATALOG_BASE . "` (`privateid`) VALUES ('" . $sql_row['privateid'] . "')";
			$mysqli_link->query($sql_query);
		}
	}
}

?>
